<template>
  <div>
    <BasicTable @register="registerTable" :searchInfo="searchInfo"></BasicTable>
  </div>
</template>
<script lang="ts" setup name="optlog">
import { BasicTable, useTable } from '@apps/antd-admin/src/components/Table';
import { page } from './api';
import { useDrawer } from '@apps/antd-admin/src/components/drawer';
import { columns, searchFormSchema } from './data';
import { useMessage } from '@apps/antd-admin/src/hooks/web/useMessage';
import { reactive } from 'vue';

const { createMessage } = useMessage();
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerTable, { reload }] = useTable({
  title: '操作日志列表',
  api: page,
  columns,
  formConfig: {
    labelWidth: 120,
    schemas: searchFormSchema,
  },
  useSearchForm: true,
  showTableSetting: true,
  bordered: true,
  showIndexColumn: true,
  actionColumn: {
    width: 80,
    title: '操作',
    dataIndex: 'action',
    slots: { customRender: 'action' },
    fixed: 'right',
  },
});

const searchInfo = reactive<Recordable>({});

function setSearchInfoProps(busType, businessId) {
  searchInfo.busType = busType;
  searchInfo.businessId = businessId;
}

defineExpose({
  setSearchInfoProps,
});
</script>
